<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>Object其他方法</h2>
</body>
<script>
    // const obj={
    //     name:'jack',
    //     age:20,
    //     address:'北京'
    // }

   //需求：将上面的obj转换成'name=jack&age=20&address=北京'

  //  let keys=[]
    // for(let key in obj) {
    //     console.log(key)
    //     keys.push(key)
    // }

    // console.log(Object.keys(obj))
    // console.log(Object.values(obj))
    // console.log(Object.entries(obj))

//    let params=''
//     Object.entries(obj).forEach(([key,value])=>{
//         params+=`${key}=${value}&`
//     })

//     console.log('params:',params.slice(0,params.length-1))

const obj={
        name:'jack',
        age:20,
        address:'北京'
  }
  Object.freeze(obj)
  obj.name='王凯'
  console.log(obj)


</script>
</html>